<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Controls</title>
    <?php
    include 'func.php';
//	creation_tableau();
  	$test=creation_tableau();
//  	print_r ($test);
  	//echo $lulu;
    echo '<script language="javascript"> var bigtab=new Array()</script>'; 
  	  
  	$taille = count($test);
  	for($i=0;$i<$taille;$i++){
  		//echo $test[$i];
  		 echo '<script language="javascript"> 
    //alert (bigtab);
    //var result=new Array("'.$koala.'",\'pilou\')
    bigtab.push("'.$test[$i].'");
    </script>'; 
  	}
  	
//
//    echo '<script language="javascript"> 
//    alert (bigtab);
//    var result=new Array("'.$koala.'",\'pilou\')
//    result.push("'.$toma.'");
//    </script>'; 

    ?>
    <script src="http://www.heatmapapi.com/javascript/HeatmapAPI.aspx?k=5c7aa16d-2f2b-4115-8196-6b8766c0e095" type="text/javascript"></script>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
            type="text/javascript"></script>
    <script src="http://www.heatmapapi.com/javascript/HeatmapAPIGoogle.js" type="text/javascript"></script>
  	<script type="text/javascript">
        var m = null;
        function loadGoogle()
        {
         if (GBrowserIsCompatible())
         {
          m = new GMap2(document.getElementById("map"));
          m.addControl(new GLargeMapControl());
          m.addControl(new GMapTypeControl());
          m.setCenter(new GLatLng(0.0, 0.0), 5);
          initHeatmap();
         }
         else
          alert('Your Internet browser is not compatible with this website.');
        }
        
        setTimeout('loadGoogle()', 1);
        
        function initHeatmap()
        {
            // Heatmap Scripts
            try
            {
                var myHM = new GEOHeatmap();
                myHM.Init(400, 300);
                
                var data =  new Array("0.0","0.0","1","10.0","10.0","1","20.0","20.0","1","30.0","30.0","5","40.0","40.0","1","50.0","50.0","1","-50.0","50.0","9");
                 
                 //alert(bigtab);
                // Generate random lat/lon and value points
                
                /*
                for(p=0;p<5;p++)
                {
                    var rLatD=Math.floor(Math.random()*1000);
                    var rLonD=Math.floor(Math.random()*1000);
                    var rValD=Math.floor(Math.random()*10);

                    data.push(39+(rLatD/15000));
                    data.push(-104+(rLonD/15000));
                    data.push(rValD); 
                    alert(data);                
                }
                */
                myHM.SetData(bigtab);
                myHM.SetBoost(1);
                myHM.SetDecay(0);
                var preUrl = myHM.GetURL();
                
                // Now render in our Google Map
                var heatmapOverlay = new HMGoogleOverlay(preUrl);
                m.addOverlay(heatmapOverlay);         
                
            }
            catch(e)
            {
             alert(e.Message);
            }
        }

    </script>            
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map" style="width: 500px; height: 300px"></div>
  </body>
</html>
